package com.zhangsr.zus.rpc.api;

import com.zhangsr.zus.common.Node;
import com.zhangsr.zus.rpc.api.exception.RpcException;

/**
 * @Author: zhangsr
 */
public interface Invoker<T> extends Node {

    /**
     * get service interface.
     * 
     * @return service interface.
     */
    Class<T> getInterface();

    /**
     * invoke.
     * 
     * @param invocation
     * @return result
     * @throws RpcException
     */
    Result invoke(Invocation invocation) throws RpcException;

}
